package son.nt.act2;

import son.nt.R;
import son.nt.act1.FavoriteActivity;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.WebView;
import android.widget.ViewAnimator;

public class AnimationActivity extends Activity{
	private static final String TAG = "AnimationActivity";
	private ViewAnimator viewAnimator = null;
	private Animation slideToRight;
	private Animation slideToLeft;
	private WebView webView = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.act2_animation);
		webView = (WebView) findViewById(R.id.webviewBiglobe);
		slideToLeft= AnimationUtils.loadAnimation(this, R.anim.slide_to_left);
		slideToRight = AnimationUtils.loadAnimation(this, R.anim.slide_to_right);
		viewAnimator = new ViewAnimator(this);
//		viewAnimator.setLayoutParams(new ViewAnimator.LayoutParams(
//				ViewAnimator.LayoutParams.FILL_PARENT,
//				ViewAnimator.LayoutParams.FILL_PARENT));
//		viewAnimator.addView(null, R.layout.act1_favorite);
		viewAnimator.setInAnimation(slideToRight);
		viewAnimator.setOutAnimation(slideToRight);
//		viewAnimator.showNext();
	}
	
	public void btnOnClick(View v){
		switch (v.getId()) {
		case R.id.btnAnimationNext:
			Log.v(TAG, "next click anomation");
//			startActivity(new Intent(this, FavoriteActivity.class));
//			overridePendingTransition(R.anim.pull_in_from_left, R.anim.hold);
//			In
			String url = getString(R.string.URL_test);
			//http://melody.pipli.jp/android/mkt/ap/user/a0/infosite_search.php
			url = "http://dev.melody.pipli.jp/android/mkt/ap/user2/a0/infosite_search.php";
			url = getString(R.string.url1);
//			url = getString(R.string.url2);
//			url = "http://dev.melody.pipli.jp/android/mkt/ap/user2/a0/siteTop.php?opengLang=en";
			url = "http://dev.melody.pipli.jp/android/mkt/ap/user2/a0/infosite_search.php?q=love";
//			Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
//			startActivity(mIntent);
//			webView.
			webView.loadUrl(url);
			
			break;

		default:
			break;
		}
	}
}
